<?php
return [
    'components' => [
        'db' => [
            'class' => 'yii\db\Connection',
            'dsn' => 'mysql:host=127.0.0.1;dbname=blogdemo2db',
            'username' => 'root',
            'password' => 'root',
            'charset' => 'utf8',
//            'class' => 'yii\db\Connection',
//            'dsn' => 'mysql:host=127.0.0.1;dbname=blogdemo2db',
//            'username' => 'blogdemo2db',
//            'password' => 'eYXnnpLTR7wwe4Hn',
//            'charset' => 'utf8',
        ],
//        'mailer' => [
//            'class' => 'yii\swiftmailer\Mailer',
//            'viewPath' => '@common/mail',
//            // send all mails to a file by default. You have to set
//            // 'useFileTransport' to false and configure a transport
//            // for the mailer to send real emails.
//            'useFileTransport' => true,
//        ],
//        'mailer'=>[
//            'class'=>'yii\swiftmailer\Mailer',
//            'useFileTransport'=>false,
//            'transport' => [
//                'class' => 'Swift_SmtpTransport',
//                'host' => 'smtp.163.com',
//                'username' => 'xianan_huang@163.com',
//                'password' => '*********',
//                'port' => '25',
//                'encryption' => 'tls',
//            ],
//        ],
        'mailer' => [
            'class' => 'yii\swiftmailer\Mailer',
            'viewPath' => '@common/mail',
            'useFileTransport' => false,    //这里一定要改成false，不然邮件不会发送
            'transport' => [
                'class' => 'Swift_SmtpTransport',
                'host' => 'smtp.163.com',
                'username' => 'alpsmasters@163.com',
                'password' => 'qwe123',        //如果是163邮箱，此处要填授权码   wzflcuzhnytpbedj  qwe123
                'port' => '25',
                'encryption' => 'tls',
            ],
            'messageConfig'=>[
                'charset'=>'UTF-8',
                'from'=>['alpsmasters@163.com'=>'admin']
            ],
        ],

    ],
];
